package com.game.chessgame;

public class ChessGame {
    public static void main(String[] args) {
        Board board = new Board();
        board.initialize();
        board.printBoard();

        while (true) {
            System.out.println("请输入你的移动（例如：e2 e4）：");
            String move = System.console().readLine();
            if (move.equalsIgnoreCase("quit")) {
                break;
            }
            String[] parts = move.split(" ");
            if (parts.length != 2) {
                System.out.println("无效的输入，请重新输入！");
                continue;
            }

            String from = parts[0];
            String to = parts[1];

            if (board.movePiece(from, to)) {
                board.printBoard();
            } else {
                System.out.println("无效的移动，请重新输入！");
            }
        }
    }
}